package com.ridu.project.beshid.repository;

import com.ridu.project.beshid.entity.JifenReqEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Repository
public interface JifenReqRepository extends JpaRepository<JifenReqEntity, Long>,JpaSpecificationExecutor<JifenReqEntity> {

    @Transactional
    @Query("from JifenReqEntity t where t.owner.beshId in ?1")
    List<JifenReqEntity> findByMobiles(List<String> list);

    @Transactional
    @Query("from JifenReqEntity t where t.id in ?1")
    List<JifenReqEntity> findByIds(List<Long> list);
}
